package com.stockz.equity.charting.view.widget;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;

import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

import com.stockz.equity.charting.view.toolbar.IndicatorToolBar;
import com.stockz.equity.model.Bar.BarValueType;
import com.stockz.equity.pattern.Child;
@Component
public class BackedByComboBox extends JComboBox implements Child,Ordered {
	private static final long serialVersionUID = -1576551817727209593L;

	@SuppressWarnings({ "rawtypes" })
	private List<Class> parentList = new ArrayList<Class>(1);
	
	public BackedByComboBox() {
		super();
		parentList.add(IndicatorToolBar.class);
		setModel(new DefaultComboBoxModel(BarValueType.values()));
		setSelectedIndex(0);
	}
	
	@SuppressWarnings("rawtypes")
	@Override
	public Collection<Class> getParents() {
		return parentList;
	}

	@Override
	public int getOrder() {
		return 2;
	}

}
